import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = () => new Vuex.Store({
    state: {
        refs: null,
        showNavBar: true //废掉了
    },
    actions: {
        async check_auth({ commit }, param) {
            const { data } = await this.$axios.post('/service/__menuCheck', param)
            return data
        },
        async update_token() {
            const { data } = await this.$axios.post('/service/__tokenTTLMod')
            return data
        }
    },
    mutations: {
        showNavBar(state, text) {
            state.showNavBar = text
        },
    }
})

export default store